package controller

import (
	"encoding/json"
	"net/http"

	"log"
)

func (p Routes) Getjson(w http.ResponseWriter, r *http.Request) {

	type Road struct {
		Name   string
		Number int
	}
	roads := []Road{
		{"Diamond Fork", 29},
		{"Sheep Creek", 51},
	}
	err := json.NewEncoder(w).Encode(roads)
	if err != nil {
		log.Fatalln(err)
	}

	//out.WriteTo(os.Stdout)
}
